<template>
    <div>
    	<div class="a">
				<div class="b">
					<van-loading type="spinner" v-if="!success"/>
				</div>			
				<div v-if="success">
					<div class="c">
						 <div><img src="../../../static/image/21.png" alt="" /></div>
						 <div class="font1">支付成功</div>
					</div>
					<div class="e">交易流水:{{orderTrade}}</div>
					<div class="d">
						<span class="d_1">返回商品详情页</span>
					</div>
				</div>
			</div>
    </div>
</template>
<script>

import { requestData } from '@/api/public'

export default {
  components: {
  },
  data () {
    return {
      commonId:'',
      invitationCode:'',
      ordersSn:'',
      success: false,
      timer:null,
      url:'/pay/alipay/trade/query',
      orderTrade:''
    }
  },
  computed: {

  },
  mounted () {
  	 this.commonId=this.$router.currentRoute.query.commonId
  	 this.invitationCode=this.$router.currentRoute.query.invitationCode
  	 this.ordersSn=this.$router.currentRoute.query.ordersSn
  	 this.query()
  },
  methods: {
     query(){
     	let that=this
     	this.timer=setInterval(function(){
     		requestData(that.url,'POST',{ordersSn:'50340734072453998082'}).then(result=>{ 
     		   if(result){
     		   	 clearInterval(that.timer)
     		   	 that.success=true
     		   	 that.orderTrade=result
     		   }               
     		})
     	},2000)
     }
  }
}
</script>
<style lang="scss" scoped>
.a{position: absolute;min-height: 100%;background: #fff;width: 100%;}
.b{position: absolute;left: 0;right: 0;bottom: 0;top:0;margin: auto;width: 100%;height: 30px;text-align: center;}
.c{display: flex;align-items: center;justify-content: center;margin-top: 30px;
  img{width: 21px;height: 21px;display: block;margin-right: 10px;}
  .font1{font-size: 16px;color: #10B992;font-weight: bold;}
}
.d{margin-top: 40px;text-align: center;}
.d_1{border: 1px solid #999999;padding: 10px 25px;border-radius: 40px;color: #666;font-size: 15px;}
.e{font-size: 14px;color: #333;text-align: center;margin: 23px 0;}
</style>
